const path = require("path");
const webpack = require("webpack");
const TerserPlugin = require("terser-webpack-plugin");

module.exports = {
  entry: {
    library: ["vue"],
  },
  output: {
    filename: "[name]_[hash].dll.js",
    path: path.join(__dirname, "./library"),
    library: "[name]",
  },
  optimization: {
    minimize: true,
    minimizer: [
      new TerserPlugin({
        extractComments: false
      })
    ]
  },
  plugins: [
    new webpack.DllPlugin({
      name: "[name]_[hash]",
      path: path.join(__dirname, "./library/[name].json"),
    }),
  ],
};
